package com.sysd.mail.pop.command;

import com.sysd.mail.pop.PopSession;

import java.io.IOException;


/**
 * project: mail
 *
 * @author bsh
 * @description BaseCommand
 * @dataTime 2023/3/27 16:56
 * @company 丽水信阳软件科技有限公司
 */
public abstract class BasePopCommand implements PopCommand {
    private final String command;

    public BasePopCommand(String command) {
        this.command = command;
    }

    /**
     * pop命令执行
     *
     * @param command    命令
     * @param popSession session
     * @throws IOException io exception
     */
    @Override
    abstract public void execute(String command, PopSession popSession) throws IOException;

    /**
     * 获取命令名称
     *
     * @return command name
     */
    @Override
    public String getCommand() {
        return this.command;
    }
}
